package com.bj58.mis.bigdata.mdp.sys;

import com.bj58.bsp.v2.common.Application;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
//import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableEurekaClient
public class SysApplication {

	@Autowired
	private RestTemplateBuilder restTemplateBuilder;

	@Bean
	public RestTemplate restTemplate(){
		return restTemplateBuilder.build();
	}


	public static void main(String[] args) {
		SpringApplication.run(SysApplication.class, args);
		String bspConfigPath = SysApplication.class.getClassLoader().getResource("app.properties").getFile();
		Application.Init(bspConfigPath);
	}
}
